package com.tomise.web;

import java.util.Properties;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.RequestMapping;

import com.tomise.core.controller.BaseController;
@Controller
public class WebController extends BaseController{
	@Autowired
	private Properties appConstant;
	
	@RequestMapping(value = "/welcome")
	protected String welcome(HttpServletResponse response) {
		return "welcome";
	}
	
	@RequestMapping(value = "/laytpl/index")
	protected String laytpl(HttpServletResponse response) {
		this.setSessionAttr("app_title", appConstant.get("app.title"));
		this.setAttr("root", this.request.getContextPath());
		return "layer/laytpl-demo";
	}

	
	@Override
	@RequestMapping(value = "/index")
	public String index(HttpServletResponse arg0, ModelMap arg1) {
		this.setSessionAttr("root", this.request.getContextPath());
		return "index";
	}

	@Override
	public void query(Integer page, Integer rows, HttpServletRequest request,
			HttpServletResponse response, ModelMap map) {
		// TODO Auto-generated method stub
		
	}

}
